package com.sunnada.nginx.bean.nginx.http;

import com.github.odiszapc.nginxparser.NgxParam;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
public class ProxySetHeader {

    @ApiModelProperty(value = "映射头")
    private String header;

    @ApiModelProperty(value = "映射值")
    private String value;

    public ProxySetHeader() {
    }

    public ProxySetHeader(String header, String value) {
        this.header = header;
        this.value = value;
    }

    public NgxParam toNgxParam() {
        NgxParam ngxParam = new NgxParam();
        ngxParam.addValue("proxy_set_header");
        ngxParam.addValue(header);
        ngxParam.addValue(value);
        return ngxParam;
    }
}
